home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 6 / The Arsenal Files 6 (Arsenal Computer).ISO / spitfire / bffindpc.zip / BFFIND.PAS < prev    next >
Pascal/Delphi Source File  |  1995-12-24  |  2KB  |  91 lines

  1. {BF-Find v1.1}
  2. {(C) 1995 Brian Leiter}
  3.  
  4. PROGRAM BFFIND;
  5.  
  6. USES DOS,CRT;
  7.  
  8. Var
  9.  DirInfo,Path   : SearchRec;
  10.  S,S1,S2        : String;
  11.  Count          : LongInt;
  12.  L,I            : Integer;
  13.  
  14. Const ProgName  = 'BFFIND';
  15.       Version   = 'v1.1';
  16.       Compiled  = '12-23-95';
  17.       CopyRight = '(C) 1995 Brian Leiter';
  18.  
  19. Procedure FindFile;
  20. Begin
  21.   FindFirst(S1, Archive, DirInfo);
  22.   While DosError = 0 Do
  23.   Begin
  24.     Count:=Count+1;
  25.     Writeln(S2,Path.Name,'\',DirInfo.Name);
  26.     FindNext(DirInfo);
  27.   End;
  28.   Exit;
  29. End;
  30.  
  31. Procedure FindDir;
  32. Begin
  33.   FindFirst('*.', Directory, Path);
  34.   S2:=S2+'\';
  35.   While DosError = 0 Do
  36.   Begin
  37.     ChDir(Path.Name);
  38.     FindFile;
  39.     ChDir('\');
  40.     FindNext(Path);
  41.   End;
  42.   Exit;
  43. End;
  44.  
  45. Procedure Start;
  46. Begin
  47.   Count:=0;
  48.   Textcolor(15);TextBackGround(4);
  49.   Writeln('╒═══════════════════════════════════╕');
  50.   Writeln('│ BFFIND v1.1              12-23-95 │');
  51.   Writeln('│                                   │');
  52.   Writeln('│ A Search And Find Utility For DOS │');
  53.   Writeln('│                                   │');
  54.   Writeln('│ (C) 1995 Brian Leiter  *FREEWARE* │');
  55.   Writeln('╘═══════════════════════════════════╛');
  56.   Textcolor(7);TextBackGround(0);
  57.   Writeln('');
  58.   S1:=ParamStr(1);
  59.   If ParamCount>0 Then
  60.   Begin
  61.     L:=Length(S1);
  62.     For I:=1 To L Do S1[I]:=UpCase(S1[I]);
  63.     Writeln('Searching For ',S1);
  64.   End;
  65.   GetDir(0,S);
  66.   If ParamCount=0 Then
  67.   Begin
  68.     Write('BFFIND What: ');
  69.     Readln(S1);
  70.     L:=Length(S1);
  71.     For I:=1 To L Do S1[I]:=UpCase(S1[I]);
  72.     If L=0 Then Halt;
  73.   End;
  74.   ChDir('\');
  75.   GetDir(0,S2);
  76.   Delete(S2,3,1);
  77.   Exit;
  78. End;
  79.  
  80. Begin
  81.   ClrScr;
  82.   Start;
  83.   Writeln('');
  84.   FindFile;
  85.   FindDir;
  86.   Chdir(S);
  87.   Writeln('');
  88.   If Count>1 Then Writeln(S1,' was found ',Count,' times in the directories listed above.');
  89.   If Count=1 Then Writeln(S1,' was found 1 time in the directory listed above.');
  90.   If Count=0 Then Writeln(S1,' was not found on this drive.');
  91. End.